package hu;

import java.util.*;

public class hu27 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] input = sc.nextLine().split(" ");
        int n = Integer.parseInt(input[0]);
        String target = input[input.length - 2];
        int k = Integer.parseInt(input[input.length - 1]);
        List<String> list = new ArrayList<>();
        char[] ch = target.toCharArray();
        Arrays.sort(ch);
        for (int i = 1; i <= n; i++) {
            if(input[i].length() != target.length())
                continue;
            char[] ch1 = input[i].toCharArray();
            Arrays.sort(ch1);
            if(new String(ch1).equals(new String(ch)) && !target.equals(input[i])){
                list.add(input[i]);
            }
        }
        Collections.sort(list);
        System.out.println(list.size());
        if(list.size() != 0 && k <= list.size())
            System.out.println(list.get(k - 1));
    }
}
/*
6 cab ad abcd cba abc bca abc 1
 */